import React, { useRef, useState } from 'react'
import { View, Text } from '@tarojs/components'
import ListTemplate from '@/components/ListTemplate'
// import Cart from '../../../components/Cart'
import './index.scss'


export default () => {
  const listRef = useRef()
  const [visible, setVisible] = useState(false)
  return (
    <View className='index'>
      <View onClick={() => setVisible(true)} >打开购物车</View>
      {/* <Cart visible={visible} onCancel={()=>setVisible(false)} /> */}
      <ListTemplate

        ref={listRef}
        useBodyScroll={false}
        preload
        pageSize={5}
        fetchFn={(params) => network.get('/api/goods/list', { ...params })}
      >
        {
          (rowData, index) => {
            return <View style={{ height: '200px', background: 'red', marginTop: '20px' }} key={index}>
              {rowData.name}
            </View>
          }
        }
      </ListTemplate>
    </View>
  )
}
